<template>
  <div class="card">
    <el-row :gutter="10" type="flex">
      <el-col
        v-for="(item,index) in totalList"
        :key="index"
        :xs="8"
        :sm="8"
        :md="8"
        :lg="6"
        :xl="4"
      >
        <div class="col-container">
          <div class="title-box">
            <span>{{ item.title }}&nbsp;</span>
            <el-tooltip popper-class="el-tooltip-theme-fresh" placement="top" effect="light">
              <div slot="content">{{ item.describe }}</div>
              <div>
                <i class="el-icon-warning app-text-color-primary" />
              </div>
            </el-tooltip>
          </div>
          <div class="total-box">
            <span class="total">{{ item.value }}</span>
            <span v-if="item.radio" class="radio">{{ item.radio.key+item.radio.value }}</span>
          </div>
          <div
            v-for="(subItem,subIndex) in item.moreInfo"
            :key="subIndex"
            class="detail-box"
          >{{ subItem }}</div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  props: {
    totalList: {
      type: Array,
      require: true,
      default: () => {
        return [
          {
            title: '我是标题',
            value: '999,999,999.99',
            describe: '我是描述',
            radio: {
              key: '环比',
              value: 1
            },
            moreInfo: ['我是额外的值', '我是额外的值']
          }
        ]
      }
    }
  },
  data() {
    return {
      // 配置
      // 状态
      // 数据
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    /**
       * 数据组
       */
    /**
       * 按钮组
       */
    /**
       * 状态组
       */
    /**
       * 方法组
       */
  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
  .card ::v-deep {
    .el-row {
      flex-wrap: wrap;
    }
  }

  .col-container {
    border-left: 2px solid #f7f7f7;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    .title-box {
      font-size: 14px;
      display: flex;
      justify-content: center;
    }
    .total-box {
      margin: 10px 0;
      display: flex;
      justify-content: center;
      align-items: center;
      .total {
        color: #000;
        font-size: 22px;
        font-weight: bold;
      }
      .radio {
        margin-left: 10px;
        font-size: 14px;
      }
    }
    .detail-box {
      font-size: 12px;
      margin-top: 6px;
    }
  }
</style>
